<ion-header *ngIf="!isFromMainPage">
  <ion-navbar>
    <ion-title>互金周报 </ion-title>
    <ion-buttons end *ngIf="hasOpAuth">
      <button ion-button (click)="moreOp()">操作</button>
    </ion-buttons>
  </ion-navbar>
</ion-header>
<ion-content>
  <ion-card class="analysis-item">
    <ion-card-header class="analysis-title" *ngIf="scaleTrendData">
      <h3>{{scaleTrendData.option.name}}</h3>
    </ion-card-header>
    <ion-list>
      <ion-item>
        <div class="scaleTrend"></div>
      </ion-item>
    </ion-list>
  </ion-card>
  <ion-card class="analysis-item">
    <ion-card-header class="analysis-title" *ngIf="channelScaleData">
      <h3>{{channelScaleData.option.name}}</h3>
    </ion-card-header>
    <ion-list>
      <ion-item>
        <div class="channelScale"></div>
      </ion-item>
    </ion-list>
  </ion-card>

  <!-- 表格100023 1000024 -->
  <ng-container *ngFor="let item of tableData; let index = index">
    <!-- 以表格形式显示 -->
    <ion-card class="analysis-item" *ngIf="item.data && item.data.length > 0 && item.option.id == 100023 || item.option.id == 100024">
      <!-- 标题 -->
      <ion-card-header class="analysis-title">
        <h3>{{item.option.name}}</h3>
      </ion-card-header>
      <!-- 描述和表格-->
      <ion-list>
        <ion-item class="analysis-table">
          <!-- thead -->
          <ion-row class="analysis-table-thead" *ngIf="item.option.title">
            <ion-col *ngFor="let key of getKeys(item.option.title)" [ngClass]="setPosition(key, item.option.id)">{{item.option.title[key]}}</ion-col>
          </ion-row>
          <!-- tbody -->
          <ng-container *ngFor="let _item of item.data; let _index = index">
            <ion-row class="analysis-table-tbody bg-red">
              <ng-container *ngFor="let key of item.option.colunm">
                <ion-col col-3 [ngClass]="setPosition(key, item.option.id)">
                  <coltrend [tableId]="item.option.id" [amount]="_item[key]" [column]="key"></coltrend>
                </ion-col>
              </ng-container>
            </ion-row>
          </ng-container>
        </ion-item>
      </ion-list>
    </ion-card>
  </ng-container>

  <ion-card class="analysis-item">
    <ion-card-header class="analysis-title" *ngIf="typeScaleChangeData">
      <h3>{{typeScaleChangeData.option.name}}</h3>
    </ion-card-header>
    <ion-list>
      <ion-item>
        <div class="typeScaleChange"></div>
      </ion-item>
    </ion-list>
  </ion-card>

  <!-- 表格100026 1000027 -->
  <ng-container *ngFor="let item of tableData; let index = index">
    <!-- 以表格形式显示 -->
    <ion-card class="analysis-item" *ngIf="item.data && item.data.length > 0 && item.option.id == 100026 || item.option.id == 100027">
      <!-- 标题 -->
      <ion-card-header class="analysis-title">
        <h3>{{item.option.name}}</h3>
      </ion-card-header>
      <!-- 描述和表格-->
      <ion-list>
        <ion-item class="analysis-table">
          <!-- thead -->
          <ion-row class="analysis-table-thead" *ngIf="item.option.title">
            <ion-col *ngFor="let key of getKeys(item.option.title)" [ngClass]="setPosition(key, item.option.id)">{{item.option.title[key]}}</ion-col>
          </ion-row>
          <!-- tbody -->
          <ng-container *ngFor="let _item of item.data; let _index = index">
            <ion-row class="analysis-table-tbody bg-red">
              <ng-container *ngFor="let key of item.option.colunm">
                <ion-col col-3 [ngClass]="setPosition(key, item.option.id)">
                  <coltrend [tableId]="item.option.id" [amount]="_item[key]" [column]="key"></coltrend>
                </ion-col>
              </ng-container>
            </ion-row>
          </ng-container>
        </ion-item>
      </ion-list>
    </ion-card>
  </ng-container>
</ion-content>
